from typing import List


class Solution:
    def removeElement(self, nums: List[int], val: int) -> int:
        i = 0
        for j in range(len(nums)):
            if nums[j] == val:
                continue
            nums[i] = nums[j]
            i += 1
        return i


if __name__ == "__main__":
    nums = [2, 3, 3, 0, 0, 1, 1, 1, 2, 4]
    val = 1
    print(Solution().removeElement(nums, val))
    print(nums)
    pass
